﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace blackhouse.Web {
    public abstract class PageProvider : InstanceFactory<PageProvider> {
        public static PageProvider Instance() {
            return Instance("PageProvider", typeof(DefaultPageProvider));
        }

        public abstract void SetCanonicalUrl(string url);
        public abstract void SetPageDescription(string description);
        public abstract void SetPageKeywords(string keywords);
        public abstract void SetPageTitle(string title);

        public void SetSeo(PageSeo seoInfo) {
            if (!String.IsNullOrEmpty(seoInfo.Title))
                this.SetPageTitle(seoInfo.Title);
            if (!String.IsNullOrEmpty(seoInfo.Description))
                this.SetPageDescription(seoInfo.Description);
            if (!String.IsNullOrEmpty(seoInfo.Url))
                this.SetCanonicalUrl(seoInfo.Url);
        }

    }
}